// consoleLogger.js

class ConsoleLogger{
    /**
     * 设置默认值为true
     * @param enabled
     */
    constructor(enabled = true,tag = "") {
        this.enabled = enabled;
        this.tag = tag;
    }

    setEnabled(enabled) {
        this.enabled = enabled;
    }

    setTag(tag){
        this.tag = tag;
    }

    log(message) {
        if (this.enabled) {
            console.log(message);
        }
    }

    debug(message) {
        if (this.enabled) {
            console.debug(message);
        }
    }

    info(message) {
        if (this.enabled) {
            console.info(message);
        }
    }

    error(message) {
        if (this.enabled) {
            console.error(message);
        }
    }

}